/****************************************************************
Table D2: Characteristics of Respondents by Number of Contact
Author: Raluca L. Pahontu
*****************************************************************/
preserve
use $vars  using "shp", clear
bysort idpers: egen how_many= count(idpers)
qui gen min2 = 1 if how_many >1
qui replace min2 = 0 if how_many == 1
qui tab rho, gen(rho_)
qui tab new_educ, gen(new_educ_)
qui tab civil_status, gen(civil_status_)
qui xi: estpost sum  social_spending rho_2 rho_3 log_household_income new_educ_2 new_educ_3 civil_status_2 civil_status_3 owner if min2 == 0
esttab, replace cells("mean(fmt(2))") noobs  ///
coeflabels(social_spending  "Social Spending" ///
rho_2 "Risk Rho2" ///
rho_3 "Risk Rho1" ///
log_household_income "Household Income (Log)" ///
new_educ_2 "Medium Education" ///
new_educ_3 "High Education" ///
civil_status_2 "Married" /// 
civil_status_3 "Divorced" /// 
owner "Owner")
qui esttab using "tabd2.tex", label booktabs cells("mean(fmt(2))") replace nomtitle nonum
qui xi: estpost sum  social_spending rho_2 rho_3 log_household_income new_educ_2 new_educ_3 civil_status_2 civil_status_3 owner if min2 == 1
esttab, replace cells("mean(fmt(2))") noobs  ///
coeflabels(social_spending  "Social Spending" ///
rho_2 "Risk Rho2" ///
rho_3 "Risk Rho1" ///
log_household_income "Household Income (Log)" ///
new_educ_2 "Medium Education" ///
new_educ_3 "High Education" ///
civil_status_2 "Married" /// 
civil_status_3 "Divorced" /// 
owner "Owner")
qui esttab using "tabd2.tex", label booktabs cells("mean(fmt(2))") append nomtitle nonum
restore



